package com.nbsaas.boot.job.rest.convert;

import com.nbsaas.boot.job.data.entity.Job;
import com.nbsaas.boot.job.api.domain.simple.JobSimple;

import com.nbsaas.boot.rest.api.Converter;

/**
* 职位-列表对象转换器
*/

public class JobSimpleConvert implements Converter<JobSimple, Job> {




@Override
public JobSimple convert(Job source) {
    JobSimple result = new JobSimple();

                result.setWages(source.getWages());
                result.setNote(source.getNote());
                result.setContactData(source.getContactData());

               try {
                   if(source.getCreator()!=null){
                       result.setCreator(source.getCreator().getId());
                   }
                } catch (Exception ignored) { }

                result.setNum(source.getNum());
                result.setWorkCity(source.getWorkCity());
                result.setName(source.getName());
                result.setDuty(source.getDuty());
                result.setSortNum(source.getSortNum());
                result.setId(source.getId());
                result.setAddDate(source.getAddDate());
                result.setLastDate(source.getLastDate());


    return result;
}

}